<script>
lang.adboard_name = '广告位名称';
</script>

<!--编辑栏目-->
<div class="dialog_content">
<form id="info_form" action="{:u(MODULE_NAME & '/' & ACTION_NAME)}" method="post">
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
    <tr>
        <th width="80">广告位名称 :</th>
        <td><input type="text" name="name" id="name" class="input-text" size="30" value="{$rs('name')}"></td>
    </tr>
    <tr>
        <th width="80">广告位类型 :</th>
        <td><select name="tpl">
			{foreach k tpl_list}
			<option value="{:tpl_list(k)("alias")}" {if tpl_list(k)("alias")=trim(rs("tpl"))}selected="selected"{/if}>{:tpl_list(k)("name")}</option>
			{/foreach}
            </select>
        </td>
    </tr>
    <tr>
        <th>广告位尺寸 :</th>
        <td>宽 : <input type="text" name="width" id="width" class="input-text" size="6" value="{$rs('width')}"> px&nbsp;&nbsp;&nbsp;&nbsp;高 : <input type="text" name="height" id="height" class="input-text" size="6" value="{$rs('height')}"></td>
    </tr>
    <tr>
        <th>广告位说明 :</th>
        <td><textarea rows="4" cols="45" class="input-textarea" id="description" name="description">{$rs('description')}</textarea></td>
    </tr>
    <tr>
        <th>{:L('enabled')} :</th>
        <td>
            <label><input type="radio" name="status" value="1" {if rs('status')=1}checked="checked"{/if}> {:L('yes')}</label>&nbsp;&nbsp;
            <label><input type="radio" name="status" value="0" {if rs('status')=0}checked="checked"{/if}> {:L('no')}</label>
        </td>
    </tr>
</table>
<input type="hidden" name="id" id="id" value="{$rs('id')}" />
</form>
</div>
<script type="text/javascript">
var check_name_url = "{:U('adboard/ajax_check_name')}";
$(function(){
    $("#name").formValidator({onshow:lang.please_input+lang.adboard_name,onfocus:lang.please_input+lang.adboard_name}).inputValidator({min:1,onerror:lang.please_input+lang.adboard_name}).ajaxValidator({
        type : "get",
        url : check_name_url,
        data: "id="+$('#id').val(),
        datatype : "json",
        async:'false',
        success : function(result){
            if(result.status == 0){
                return false;
            }else{
                return true;
            }
        },
        buttons: $("#dosubmit"),
        onerror : lang.adboard_already_exists,
        onwait : lang.connecting_please_wait
    }).defaultPassed();
});
</script>